const mongoose = require('mongoose');
// 创建用户集合规则
const personInfoSchema = new mongoose.Schema({
	personId:{
		type: mongoose.SchemaTypes.ObjectId
	},
	name: {
		type: String,
		required: true,
		minlength: 2,
		maxlength: 20
	},
	cardId: {
		type: String,
		min: 18,
		max: 18
	},
	// password: String,
	// email: String,
	// hobbies: [String]
}); 

// 创建集合 返回集合构造函数
const personInfo = mongoose.model('personInfo', personInfoSchema);

module.exports = personInfo;
